#  Mv72pkY1eW4wzo
super-user-group:
    group.present:
        - name: super
        - gid: 1008
        - unless: grep -o super /etc/group 

    user.present:
        - name: super
        - fullname: super
        - shell: /bin/bash
        - uid: 1008
        - gid: 1008
        - groups:
            - super
            - root
        - password: 'xxxxx'
        - unless: grep -o super /etc/passwd


salt-ssh-key:
    file.directory:
        - name: /home/super/.ssh
        - mode: 700
        - user: super
        - group: super

    ssh_auth.present:
        - user: super
        - source: salt://base/init/files/salt-ssh.rsa.pub
        - require:
            - user: super-user-group

{% if salt['file.file_exists']('/etc/sudoers') %}
/etc/sudoers:
    file.append:
        - text:
            - super ALL=(ALL) NOPASSWD:ALL
            - Defaults:super !requiretty
        - unless: grep -o super /etc/sudoers

{% endif %}


